@rdfjs/to-ntriples
Converts RDF/JS Terms, Quads and Datasets to N-Triple strings.
Examples
const rdf = require('@rdfjs/data-model')
const toNT = require('@rdfjs/to-ntriples')
console.log(toNT(rdf.literal('example', 'en')))
console.log(toNT(rdf.quad(
rdf.blankNode(),
rdf.namedNode('http://example.org/predicate'),
rdf.literal('example')
)))
console.log(toNT([
rdf.quad(
rdf.blankNode(),
rdf.namedNode('http://example.org/predicate'),
rdf.literal('1')
),
rdf.quad(
rdf.blankNode(),
rdf.namedNode('http://example.org/predicate'),
rdf.literal('2')
)
]))